package com.ptl.bp.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Table;

import javax.persistence.Column;
import javax.persistence.Entity;
import java.util.Date;

@Schema(description = "Token信息实体")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "token_info")
@Entity(name = "token_info")
@Table(appliesTo = "token_info", comment = "token记录")
public class TokenInfoEntity extends BaseEntity {

    @Column(columnDefinition = "TEXT")
    @Schema(description = "访问Token", example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...")
    private String accessToken;

    @Column(columnDefinition = "TEXT")
    @Schema(description = "刷新Token", example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...")
    private String refreshToken;

    @Schema(description = "访问Token过期时间", example = "2023-06-15T12:00:00.000Z")
    private Date accessTokenExpiry;

    @Schema(description = "刷新Token过期时间", example = "2023-06-22T12:00:00.000Z")
    private Date refreshTokenExpiry;

}